
--[[

    slimui - Copyright (c) 2011 atom0s, All rights reserved.

    See Copyright notice in slimui.lua
    
]]--

class 'Component: Object' { ... };

----------------------------------------------------------------------------------
-- func: Component.__init__
-- desc: Constructor called when this object is first created.
----------------------------------------------------------------------------------
function Component.__init__( self )
    Object.__init__( self );
end

----------------------------------------------------------------------------------
-- func: Component:ComponentCount
-- desc: Returns the number of components the given object has.
----------------------------------------------------------------------------------
function Component:ComponentCount( )
    return component_getComponentCount( self._object );
end

----------------------------------------------------------------------------------
-- func: Component:Components
-- desc: Returns the component found at the given index.
----------------------------------------------------------------------------------
function Component:Components( index )
    return component_getComponent( self._object, index );
end

----------------------------------------------------------------------------------
-- func: Component:GetComponentByName
-- desc: Returns the component object of the given name.
----------------------------------------------------------------------------------
function Component:GetComponentByName( name )
    return component_getComponentByName( self._object, name );
end

----------------------------------------------------------------------------------
-- func: Component:GetName
-- desc: Returns this components name.
----------------------------------------------------------------------------------
function Component:GetName( )
    return component_getComponentName( self._object );
end

----------------------------------------------------------------------------------
-- func: Component:SetName
-- desc: Sets this components name.
----------------------------------------------------------------------------------
function Component:SetName( name )
    component_setComponentName( self._object, name );
end

----------------------------------------------------------------------------------
-- func: Component:GetTag
-- desc: Returns this components tag.
----------------------------------------------------------------------------------
function Component:GetTag( )
    return component_getComponentTag( self._object );
end

----------------------------------------------------------------------------------
-- func: Component:SetTag
-- desc: Sets this components tag.
----------------------------------------------------------------------------------
function Component:SetTag( tag )
    component_setComponentTag( self._object, tag );
end

----------------------------------------------------------------------------------
-- func: Component:Owner
-- desc: Returns this components owner.
----------------------------------------------------------------------------------
function Component:Owner( )
    return component_getComponentOwner( self._object );
end



--[[ Debug information. ]]--------------------------------------------------------
if ( slimui:isdebug() == true ) then
    slimui:msg( '(Base) component.lua successfully loaded.' );
end